import axios from '@/core/utils/AxiosRequest'
import ThrottleRequest from '@/core/utils/ThrottleRequest'
/**
 * 系统-文件-接口
 */
const prefix = '/api/system/file'
export default {
  /**
   * 获取分页表
   * @param {*} payload
   * @returns
   */
  getListByPage(payload) {
    //console.info(JSON.stringify(payload))
    //return axios.get(prefix + '/getListDataByPage', { params: payload })
    return ThrottleRequest(`${prefix}/getListDataByPage`, payload)
  },

  /**
   * 获取按ID获取表单信息
   * @param {*} id
   * @returns
   */
  getFormModelById(id) {
    return axios.get(prefix + '/getFormDataById?id='+id)
  },

  /**
   * 保存数据
   * @param {*} payload
   * @returns
   */
  saveData(payload) {
    //alert(JSON.stringify(payload))
    return axios.post(prefix + '/saveData', payload)
  },

  /**
   * 多个key删除数据
   * @param {key[]} payload
   * @returns
   */
  removeData(payload) {
    return axios.get(prefix + '/delete', {params: payload})
  }
}